package com.junlaninfo;

/**
 * Created by 辉 on 2020/12/28.
 * ***\*定义打印数组元素方法,按照给定的格式打印[11, 33, 44, 22, 55]\****
 */
public class test {
    public static void main(String[] args) {
        int[] arr = {11, 33, 44, 22, 55};
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            if (i == arr.length - 1) {
                System.out.print(arr[arr.length - 1] + "]");
            } else {
                System.out.print(arr[i]+",");
            }
        }
    }
}
